$(function (){


	$(window).on("",function (){})

	$("#login").on("click",function (){
		var name = $("#ipt_name").val();
		var password = $("#ipt_password").val();

		$.ajax({
			url:"/manager/login",
			method:"post",
			data:"_method=put&userName="+name+"&password="+password,
			success:function(data){
				console.log(data);
				if(data==null||data==""){
					layui.use('layer', function(){
						var layer = layui.layer;
						layer.msg('用户名或密码错误,登陆失败',{
							icon: 2,
							time: 3000,
							anim: 1,

						});
					});
				}else{
					layui.use('layer', function(){
						var layer = layui.layer;
						layer.msg('登陆成功, '+data.realName,{
							icon: 6,
							time: 1000
						},function (){
							location.href="login";
						});
					});

				}
			}
		})
		return false;
	})
})